package com.sanalkitaplik.resources;

import java.util.ArrayList;

public abstract class AbstractBook {
	
	protected String cover;
	protected String title;
	protected String genre;
	protected String description;
	protected ArrayList<String> authorList;
	
	public AbstractBook() {
		this.title = "";
		this.cover = "";
		this.authorList = new ArrayList<String>();
	}
	
	public void setTitle(String title) {
		this.title = title;
	}
	
	public String getTitle() {
		return this.title;
	}
	
	public void setGenre(String genre) {
		this.genre = genre;
	}
	
	public String getGenre() {
		return this.genre;
	}
	
	public void setDescription(String description) {
		this.description = description;
	}
	
	public String getDescription() {
		return description;
	}
	
	public void setCover(String cover) {
		this.cover = cover;
	}
	
	public String getCover() {
		return this.cover;
	}
	
	public void addAuthor(String authorName) {
		this.authorList.add(authorName);
	}
	
	public String getAuthorName(int i) {
		return authorList.get(i);
	}
	
	public String getAuthorNames() {
		String names = "";
		for (int i=0; i<authorList.size(); i++) {
			names += authorList.get(i);
			names += "<br/>";
		}
		return names;
	}

}
